<template>
  <!-- 提交的提醒 start -->
  <XnDialog custom-class="board1_dialog" title="导出" :visible.sync="selfVisible" @close="onClose" width="520px">
    <el-checkbox-group v-model="checkList" class="check">
      <el-checkbox :label="item.value" v-for="item in list" :key="item.value" :disabled="item.isCheck">
        {{ item.label }}
      </el-checkbox>
    </el-checkbox-group>
    <div class="sunmit_tips">
      <el-button @click="onClose" size="small">取消</el-button>
      <el-button type="primary" @click="sureExport" size="small">确定</el-button>
    </div>
  </XnDialog>
  <!-- 收藏成功提醒 end -->
</template>

<script>
import XnDialog from '@com/xnDialog.vue'
import { getListAssessExportFileType } from '@apis/grade.js'
export default {
  props: {
    exportShow: {
      type: Boolean,
      default: false,
    },
  },
  components: { XnDialog },
  data() {
    return {
      checkList: [],
      list: [],
      selfVisible: false,
    }
  },
  watch: {
    exportShow(visible) {
      this.selfVisible = visible
      if (visible) {
        this.getListAssessExportFileType()
      }
    },
  },
  created() {
    // this.getListAssessExportFileType()
  },
  mounted() {},
  methods: {
    onClose() {
      this.checkList = []
      this.selfVisible = false
      this.$emit('close')
      this.$emit('update:visible', false)
    },
    sureExport() {
      if (this.checkList.length === 0) return this.$message.warning('请勾选需要下载的内容')
      this.$emit('onExport', this.checkList.join(','))
      this.checkList = []
    },
    getListAssessExportFileType() {
      getListAssessExportFileType().then(res => {
        if (res.status === 200) {
          this.list = res.data
        }
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.board1_dialog {
  display: flex;
  align-items: center;
  font-size: 20px;
  padding-left: 20px;
  color: #333;
  /deep/ .el-dialog__headerbtn .el-dialog__close {
    color: #fff;
  }
  /deep/ .el-dialog__headerbtn {
    top: 17px;
  }

  /deep/ .el-dialog__header {
    background: #004db6;
    padding: 13px 10px 10px 10px;
  }
  /deep/ .el-dialog__title {
    line-height: 6px;
    font-size: 20px;
    color: #fff;
    padding-left: 5px;
  }
  /deep/ .el-dialog__body {
    padding: 20px 20px 10px;
    font-size: 16px;
    line-height: 30px;
    /deep/.el-checkbox__label {
      font-size: 14px;
    }
  }
  .bot_tips {
    border-top: 1px solid #ececec;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
  }
  .bot_tips_btn {
    cursor: pointer;
    color: #1852a3;
    font-size: 16px;
  }
  .color_warning_dia {
    color: #e6a23c;
    font-size: 18px;
  }
  .color-font {
    font-size: 18px;
  }
  .sunmit_tips {
    margin-top: 15px;
    text-align: right;
    /deep/ .el-button--mini,
    .el-button--small {
      font-size: 16px;
    }
  }
}
.check {
  display: flex;
  flex-direction: column;
  /deep/.el-checkbox {
    font-size: 16px;
    margin-bottom: 8px;
    .el-checkbox__label {
      font-size: 16px;
    }
  }
}
</style>
